<?php
include("db.php");
if (isset($_GET['do'])) {
    $do = $_GET['do'];
} else {
    die("invild action");
}
switch ($do) {
    case "shareready":
        shake_ready();
        break;
}

function shake_ready()
{
    $datapath = str_replace("/shake", '/', dirname(__FILE__));
    $configpath = $datapath . '/data/memcache.php';
    if (file_exists($configpath)) {
        require($configpath);
        if ($use_memcache == 1) {
            $mem = new Memcache;
            $mem->connect($memcache_host, $memcache_port);
            $mem->flush();
        }
    }
    $wall_config_m = new M('wall_config');
    $wall_config_m->update("1", array('isopen' => 1));
    $shake_toshake_m = new M('shake_toshake');
    $shake_toshake_m->update("1", array('point' => 0));
    echo '1';
}